.

Avoiding “Deaths by PowerPoint”
Data Storytelling and Python to the rescue
Sebastián Flores, PyCon US 2024, May 20th

Acerca de mí


  • Sebastián Flores aka sebastiandres
  • Chief Data Officer at uPlanner
  • Member of Python Chile
  • Collaborator to Streamlit and Vizzu

Agenda

  • No
  • Nope
  • No chance

Rule #1 of Storytelling:

Always raise the stakes!

Never give away the ending!

Data Storytelling

Why Data Storytelling?

¿Storytelling?





Stories are older than all of our technology

Ohh, those hackable brains

Peak-End Rule by sketplanation

. . .

Game of Thrones rating by Kelvin Neo




Data Storytelling:

Using storytelling tricks to create presentations that will be remembered and that create impact

Emotions create actions

The best example



How to make millions of people share statistics on social media?


3 Skills


and


2 Tools

Data Storytelling

Skill #1: Public Speaking





Public Speaking is

SCARY

Attention control





Control the attention without being manipulative?

Data Storytelling

Tool #1: Visualization

Data Exploratory Viz

Too many options!
User cannot be in charge of finding the insights.

Data Explanatory Viz

So many good python libraries!

  • Classic: Matplotlib
  • Rising starts: Seaborn, Plotly, Altair
  • Other: plotnine, pygal, bokeh

Pick one and master it

Vizzu

A Data Storytelling library in JS & Python

#| code-fold: true
#| code-summary: "Show the code"

import pandas as pd
 
from ipyvizzu import Data, Config, Style
from ipyvizzustory import Story, Slide, Step
 
 
# Create data object, read csv to data frame and add data frame to data object
data = Data()
df = pd.read_csv(
    "./data/population.csv",
    dtype={"Year": str},
)
data.add_df(df)
 
 
# Create story object, add data to it
story = Story(data=data)
 
# Set the size of the HTML element
# that appears within the notebook
story.set_size("100%", "400px")
 
# Switch on the tooltip that appears
# when the user hovers the mouse over a chart element
story.set_feature("tooltip", True)
 
 
# Each slide here is a page in the final interactive story
# Add the first slide
slide1 = Slide(
    Step(
        Data.filter("record.Continent == 'Africa'"),
        Config.stackedArea(
            {
                "x": "Year",
                "y": "Medium",
                "stackedBy": "Subregion",
                "title": "Population of Africa 1953-2098",
            }
        ),
        Style({"plot": {"xAxis": {"label": {"angle": 2.0}}}}),
    )
)
# Add the slide to the story
story.add_slide(slide1)
 
slide2 = Slide(
    Step(
        Config.percentageArea(
            {
                "x": "Year",
                "y": "Medium",
                "stackedBy": "Subregion",
            }
        ),
    )
)
story.add_slide(slide2)
 
slide3 = Slide(
    Step(
        Config.stream(
            {
                "x": "Year",
                "y": "Medium",
                "stackedBy": "Subregion",
            }
        ),
    )
)
story.add_slide(slide3)
 
slide4 = Slide(
    Step(
        Config.violin(
            {
                "x": "Year",
                "y": "Medium",
                "splittedBy": "Subregion",
            }
        ),
    )
)
story.add_slide(slide4)
 
 
# Play the created story!
story.play()

Data Storytelling

Skill #2: Storytelling

¿Data Storytelling?




Easy to judge, hard to prepare

Acerca de las historias





Stories are simple

. . .

start, conflict, ending.

Don’t focus on the numbers. Focus on the story.

(C) Storytelling with Data, por Cole Nussbaumer Knaflic.

Data Storytelling

Tool #2: Presentation

Presentation tools

  • Classic: PowerPoint
  • Interactive: quarto, jupyter + RISE, streamlit
  • Other: canvas, revealjs, prezi

Sistema de publicación científica y técnica, construida en Pandoc.

Foco en markdown científico, código, reproducibilidad e interacción.

Code

---
title: "Habits"
author: "John Doe"
format:
  revealjs:
    transition: fade
    theme: black
    toc: true
    center: true
---

## Getting up

- Turn off alarm
- Get out of bed

---

## Going to sleep 
::: { .incremental }

- Get in bed
- Count sheep

:::

Slides

Quarto

Pros

Cons

  • Plain markdown files
  • One format to rule them all!
  • Lots of configuration options
  • Interactivity if compiled before
  • Cannot execute code in real time



Jupyter + RISE

Evaluación de código “en vivo”

https://rise.readthedocs.io/

Jupyter + RISE

Pros

Cons

  • Execute code in real time
  • If runs on jupyter, can be shown!
  • Very hard to personalize
  • Notebook versioning is not “git-friendly”

Show don’t tell

Guido was very happy

Guido …



Streamlit

As interactive as you can code…

¿Cómo decidir?

  • PowerPoint: Single use no-code presentation
  • Quarto: Talks from related documents (books, articles)
  • Jupyter + RISE: Workshops or classes. Executing code is important.
  • Streamlit: Experimental presentations?

Data Storytelling

Tool #3: AI



  • Don’t search images, create them!
  • Use AI chatbots for:
    • Analogies and examples
    • Prompts to create better images!

End

Two stories

Data Storytelling for me

Data Storytelling for you?

I believe that…



  • Data Storytelling is a crucial skill
  • YOU can learn Data Storytelling skills and tools

Feedback

flowchart LR
  A{"Liked the talked?"} --> |Yes| B{"Answer feedback?"}
  A --> |No| B
  B --> |Yes| C{"Keep in touch?"}
  C --> Z["Thanks for coming to my talk!"]
  B --> |No| Z

https://tally.so/r/3NAPeb

¡Gracias!

sebastiandres | https://sebastiandres.xyz

https://tally.so/r/3NAPeb

¡Gracias!

sebastiandres | https://sebastiandres.xyz